from rest_framework.serializers import ModelSerializer
from apps.goods.models import SPUSpecification
from rest_framework import serializers


class SPUSpecificationModelSerializer(ModelSerializer):
    """规格表管理序列化器"""
    spu = serializers.StringRelatedField()
    spu_id = serializers.IntegerField()

    class Meta:
        model = SPUSpecification
        fields = ('id', 'name', 'spu', 'spu_id')
